import request from '@/utils/request'

/**
 * 注册
 * @param {*}} param
 */
export function register(param) {
  return request({
    url: '/api/user/register',
    method: 'post',
    data: param
  })
}

/**
 * 登录
 * @param {*} id
 */
export function login(param) {
  return request({
    url: '/api/user/login',
    method: 'post',
    data: param
  })
}

/**
 * 登出
 */
export function logout() {
  return request({
    url: '/api/user/logout',
    method: 'post'
  })
}


export function getInfo() {
  return request({
    url: '/api/user/my/info',
    method: 'get'
  })
}

export function search(username) {
  return request({
    url: '/api/user/search?username=' + username,
    method: 'get'
  })
}
